/*  
 *  Nanjing JIYU Technology Co.,Ltd All rights reserved.
 *  Copyright (C) 2022 
 *  ==============================================================
 * 
 *  hostpc.c 
 *    上位机通信和指令处理
 *
 *  --------------------------------------------------------------
 *  
 */

#include "hostpc.h"

#include "peripheral.h"
#include "status.h"


/*  
 *  uart3_rx_data在中断里更新，
 */
void hostpc_cmd_refresh(void)
{
  /* 自动运行模式，数据含义为目标位置 */
  if ((uart3_rx_data <= '8') && (uart3_rx_data >= '0'))
  {
    status.control_mode = automatic;
    status.destination = uart3_rx_data;
  }

  else /* abcd ws 上位机控制运行，数据含义为指令  */
  {
    status.control_mode = controlled;
    status.ctrl_cmd = uart3_rx_data;
  }
}



